package hu.bme.mit.Grafilogika.client;

import com.google.gwt.user.client.ui.Label;

public class NonogramTableElement extends Label {
	enum State {BLANK, MARKED, INVALID} 
	
	private State state;
	
	public NonogramTableElement() {
		super();
		setWidth("25px");
		setHeight("25px");
		setState(State.BLANK);
		setStyleName("blank"); 
//		setText("B");
		super.setVisible(true);
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}
	
	public void changeState() {
		switch (state) {
		case BLANK: 	setState(State.MARKED); 
						setStyleName("marked"); 
//						setText("B");
						break;
		case MARKED: 	setState(State.INVALID); 
						setStyleName("invalid"); 
//						setText("M");
						break;
		case INVALID: 	setState(State.BLANK); 
						setStyleName("blank"); 
//						setText("I");
						break;

		default:
			break;
		}
	}	
}
